home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-10-13 | 16.8 KB | 490 lines | [TEXT/MPS ] |
- ; Version: 1.03
- ; Created: Tuesday, August 2, 1988 at 9:22:13 PM
- ;
- ; File: ATalkEqu.a
- ;
- ; Assembler Interface to the Macintosh Libraries
- ; Copyright Apple Computer, Inc. 1984-1988
- ; All Rights Reserved
- ;
- ; AppleTalk Equates - This file defines the low-level equates for the
- ; AppleTalk drivers.
- ;--------------------------------------------------------------------
- ;
- atpLoadedBit EQU 4 ; Bit number for ATP loaded in PortBUse
- ;
- ; AppleTalk unit numbers
- ;
- mppUnitNum EQU 9 ; MPP unit number
- atpUnitNum EQU 10 ; ATP unit number
- ;
- ;
- ;+ Name Binding Protocol (NBP)
- ;
- nbp EQU $02 ; DDP protocol type code for NBP
- ;
- nbpControl EQU 0 ; Control code
- nbpTCount EQU 0 ; Tuple count
- nbpID EQU 1 ; NBP ID
- nbpTuple EQU 2 ; Start of the first tuple
- ;
- ;NBP tuple header offsets:
- ;
- tupleNet EQU 0 ; Offset to network no. [word]
- tupleNode EQU 2 ; Offset to node ID [byte]
- tupleSkt EQU 3 ; Offset to socket number [byte]
- tupleEnum EQU 4 ; Offset to enumerator [byte]
- tupleName EQU 5 ; Offset to name part of tuple [byte]
- tupleAddrSz EQU 5 ; tuple address field size
- ;
- ; NBP control codes - the following define the different types of NBP packets:
- ;
- brRq EQU 1 ; Broadcast request
- lkUp EQU 2 ; Lookup request
- lkUpReply EQU 3 ; Lookup reply
- ;
- ; NBP miscellaneous
- ;
- nis EQU 2 ; Names Information Socket (NIS) number
- tupleMax EQU 15 ; Most tuples in a lookup reply
- equals EQU '=' ; Wildcard symbol
- star EQU '*' ; "This zone" symbol
- ;
- ;
- ;+ Routing Table Maintenance Protocol (RTMP)
- ;
- rtmp EQU $01 ; DDP protocol type code for RTMP
- ;
- ; RTMP header offsets
- ;
- rtmpNet EQU 0 ; Offset to network number [word]
- rtmpIDLen EQU 2 ; Offset to ID length [byte]
- rtmpID EQU 3 ; Offset to start of ID field
- ;
- ; RTMP packets are received at the well-known RTMP listening socket:
- ;
- rtmpSkt EQU 1 ; Number of the RTMP socket
- ;
- ;
- ;;+ Datagram Delivery Protocol (DDP)
-
- ddpHopCnt EQU 0 ; Hop count (only used in long header) [byte]
- ddpLength EQU 0 ; Packet length (from this word onwards) [word]
- ddpChecksum EQU 2 ; Checksum [word]
- ddpDstNet EQU 4 ; Destination network no. [word]
- ddpSrcNet EQU 6 ; Network of origin [word]
- ddpDstNode EQU 8 ; Destination node address [byte]
- ddpSrcNode EQU 9 ; Node of origin [byte]
- ddpDstSkt EQU 10 ; Destination socket number [byte]
- ddpSrcSkt EQU 11 ; Source socket number [byte]
- ddpType EQU 12 ; DDP type field [byte]
- ;
- sddpDstSkt EQU 2 ; Destination socket number (short header) [byte]
- sddpSrcSkt EQU 3 ; Source socket number (short header) [byte]
- sddpType EQU 4 ; DDP type field (short header) [byte]
- ;
- ddphSzLong EQU 13 ; Size of extended DDP header
- ddphSzShort EQU 5 ; Size of short DDP header
- ;
- shortDDP EQU $01 ; LAP type code for DDP (short header)
- longDDP EQU $02 ; LAP type code for DDP (long header)
- ;
- ; DDP miscellaneous
- ;
- ddpMaxWKS EQU $7F ; The highest valid well-known socket
- ddpMaxData EQU 586 ; Maximum DDP data size
- ddpLenMask EQU $03FF ; Mask for DDP length
- ;
- ;
- ;+ AppleBus Link Access Protocol (ABLAP)
- ;
- lapDstAdr EQU 0 ; Destination node address [byte]
- lapSrcAdr EQU 1 ; Source node address [byte]
- lapType EQU 2 ; LAP type field [byte]
- lapHdSz EQU 3 ; Size of LAP header
- ;
- ; zs returned by ReadPacket and ReadRest routines
- ;
- overrunErr EQU -1
- crcErr EQU -2
- underrunErr EQU -3
- lengthErr EQU -4
- ;
- ; SCC interrupt priority
- ;
- sccLockout EQU $2600 ; This value works on both Mac and Lisa
- ;
- ;
- ;+ MPP (control calls to NBP, DDP and ABLAP)
- ;
- lookupReply EQU 242 ; This command queued to ourself
- writeLAP EQU 243 ; Write out LAP packet
- detachPH EQU 244 ; Detach LAP protocol handler
- attachPH EQU 245 ; Attach LAP protocol handler
- writeDDP EQU 246 ; Write out DDP packet
- closeSkt EQU 247 ; Close DDP socket
- openSkt EQU 248 ; Open DDP socket
- loadNBP EQU 249 ; Load NBP command-executing code
- lastResident EQU 249 ; Last resident command
- confirmName EQU 250 ; Confirm name |
- lookupName EQU 251 ; Look up name on internet |
- removeName EQU 252 ; Remove name from Names Table |_ Swapped
- registerName EQU 253 ; Register name in Names Table | In
- killNBP EQU 254 ; Kill outstanding NBP request |
- unloadNBP EQU 255 ; Unload NBP command code |
- ;
- firstMPP EQU 242 ; First MPP command
- lastMPP EQU 255 ; Last MPP command
- ;
- ; MPP queue element standard structure: arguments passed in the CSParam area
- ;
- socket EQU $1C ; Offset to socket number (DDP) [byte]
- checkSumFlag EQU $1D ; Offset to checksum flag (DDP) [byte]
- listener EQU $1E ; Offset to socket listener (DDP) [word]
- argBlkSz EQU $10 ; Size of argument block to WriteDDP
- wdsPointer EQU $1E ; Offset to WDS pointer (DDP & ABLAP) [word]
- ;
- protType EQU $1C ; Offset to protocol type code (ABLAP) [byte]
- handler EQU $1E ; Offset to protocol handler (ABLAP) [word]
- ;
- interval EQU $1C ; Retry interval (NBP) [byte]
- count EQU $1D ; Retry count (NBP) [byte]
- entityPtr EQU $1E ; Entity pointer (NBP)
- ntQElPtr EQU $1E ; NT queue element ptr (NBP - Register)
- confirmAddr EQU $22 ; Address to confirm at (NBP - Confirm)
- newSocket EQU $26 ; Socket no. if different (NBP - Confirm) [byte]
- ;
- verifyFlag EQU $22 ; Verify name flag (NBP - Register) [byte]
- ;
- retBuffPtr EQU $22 ; Return buffer pointer (NBP - Lookup)
- retBuffSize EQU $26 ; Return buffer size (NBP - Lookup) [word]
- maxToGet EQU $28 ; Max no. responses to get (NBP - Lookup) [word]
- numGotten EQU $2A ; Number actually gotten (NBP - Lookup) [word]
- ;
- ; Names Table Queue element - the MPP registered names (and associated sockets)
- ;
- ntLink EQU 0 ; Link to next element
- ntTuple EQU 4 ; Start of tuple for replies
- ntSocket EQU 7 ; Socket number of entity [byte]
- ntEntity EQU 9 ; Start of entity name within tuple
- ;
- ; Well-known offsets within MPP local variables (as pointed to by AbusVars)
- ;
- sysLAPAddr EQU 0 ; This node's LAP address
- toRHA EQU 1 ; Top of RHA
- sysABridge EQU $19 ; Node address of a bridge [byte]
- sysNetNum EQU $1A ; This node's network number [word]
- vSCCEnable EQU $1C ; SR value to re-enable SCC interrupts [word]
- atpVars EQU $1E ; ATP variable pointer (high byte is flag)
- afterGlobals EQU $22 ; After the globals
- ;
- ; MPP miscellaneous
- rhaSize EQU $18 ; Size of read header area
- wdsEntrySz EQU 6 ; Size of a WDS entry
- ;
- ;
- ;
- ;+ AppleTalk Transaction Protocol (ATP)
- ;
- atp EQU $3 ; ATP type code (in DDP header)
- ;
- ; ATP header
- ;
- atpControl EQU 0 ; Control field [byte]
- atpBitmap EQU 1 ; Bitmap (requests only) [byte]
- atpRespNo EQU 1 ; Response number (responses only) [byte]
- atpTransID EQU 2 ; Transaction ID [word]
- atpUserData EQU 4 ; Start of user data [long]
- atpHdSz EQU 8 ; Size of ATP header
- ;
- ; ATP control field
- ;
- atpReqCode EQU $40 ; Request code after masking
- atpRspCode EQU $80 ; Response code after masking
- atpRelCode EQU $C0 ; Release code after masking
- atpXOBit EQU 5 ; Bit number of exactly-once bit
- atpEOMBit EQU 4 ; Bit number of End-Of-Message bit
- atpSTSBit EQU 3 ; Send Transmission Status bit no.
- flagMask EQU $3F ; Mask for just flags
- controlMask EQU $F8 ; Mask for good control bits
- ;
- ; ATP limits
- ;
- atpMaxNum EQU 8 ; Max no. of responses per request
- atpMaxData EQU $242 ; Maximum data size in ATP packet
- ;
- ; ATP contol calls
- ;
- relRspCB EQU 249 ; Release RspCB | |
- closeATPSkt EQU 250 ; Close ATP socket | |
- addResponse EQU 251 ; Add response code | Require open skt |
- sendResponse EQU 252 ; Send response code | |
- getRequest EQU 253 ; Get request code | |
- openATPSkt EQU 254 ; Open ATP socket
- sendRequest EQU 255 ; Send request code
- relTCB EQU 256 ; Release TCB
- ;
- firstATP EQU 249 ; First ATP command
- lastATP EQU 256 ; Last ATP command
- firstNoSkt EQU 254 ; First not requiring an open socket
- ;
- ; ATP queue element standard structure: arguments passed in the CSParam area
- ;
- atpSocket EQU $1C ; Socket number is first parameter [byte]
- atpFlags EQU $1D ; Flag [byte]
- addrBlock EQU $1E ; Start of address block
- reqLength EQU $22 ; Size of request buffer [word]
- reqPointer EQU $24 ; Pointer to request buffer or data
- bdsPointer EQU $28 ; Pointer to Buffer Data Structure (BDS)
- guArea EQU $2C ; Start of general-use area
- userData EQU $12 ; User bytes
- ;
- ; ATP bits
- ;
- sendCHK EQU 0 ; Bit no. of send-checksum bit in flags
- tidValid EQU 1 ; Bit set when TID valid in SendRequest
- ;
- ; SendRequest call interface
- ;
- numOfBuffs EQU $2C ; No. of response buffers passed in BDS [byte]
- timeoutVal EQU $2D ; Timeout length in seconds [byte]
- numOfResps EQU $2E ; Number of responses received [byte]
- retryCount EQU $2F ; Maximum number of retries [byte]
- ;
- reqTID EQU $16 ; Request's TID returned here (for RelTCB)
- currBitmap EQU $1C ; Bitmap of responses not yet received [byte]
- ;
- ; GetRequest call interface
- ;
- bitmap EQU $2C ; Offset where bitmap is returned [byte]
- transID EQU $2E ; Transaction ID returned here [word]
- ;
- ; SendResponse call interface
- ;
- bdsSize EQU $2D
- ;
- ; AddResponse call interface
- ;
- rspNum EQU $2C ; No. of this response with transaction [byte]
- ;
- ; ATP general
- ;
- maxReqs EQU 6 ; Maximum number of concurrent requests
- maxRsps EQU 8 ; Max number of concurrent XO responses
- maxATPSkts EQU 6 ; Max number of concurrent responding-sockets
- releaseTime EQU 30 ; Release timer value in seconds
- ;
- ; ATP Buffer Descriptor Structure (BDS)
- ;
- bdsBuffSz EQU 0 ; Send: data length Receive: buffer length
- bdsBuffAdr EQU 2 ; Send: data address Receive: buffer address
- bdsDataSz EQU 6 ; Send: used internally Receive: data length
- bdsUserData EQU 8 ; Send: 4 user bytes Receive: 4 user bytes
- bdsEntrySz EQU 12 ; Size of a BDS entry
- ;
- ;
- ;*************** NEW APPLETALK INFO **************
- ;
- setSelfSend EQU 256 ; MPP: Set to allow writes to self
- ;
- newSelfFlag EQU $1C ; Offset: New value for self-send flag
- oldSelfFlag EQU $1D ; Old value of self-send flag
- nKillQEl EQU $1C ; Pointer to queue element to abort (KillNBP)
- ;
- nSendRequest EQU 248 ; ATP: NSendRequest code
- killGetReq EQU 257 ; ATP: Kill GetRequest
- killSendReq EQU 258 ; ATP: Kill SendRequest
- ;
- aKillQEl EQU $2C ; Offset: Pointer to queue element to abort
- ;
- ncVersion EQU 45 ; First version with new AppleTalk calls
- sMgrROM EQU $76 ; First ROM with start manager/AGB pointer
- ;
- ;
- ; AppleTalk Global Block (AGB) definitions - the following block is pointed to by
- ; a handle in low memory (if ROM). It looks as follows:
- ; .LONG XPP variable pointer (zero = none)
- ; .LONG XPP patch hook (zero = none)
- ; .LONG ATP patch hook (zero = none)
- ; .LONG filler
- ;
- ;
- xppVarPtr EQU 0 ; Offset to XPP variable pointer
- xppHook EQU 4 ; Offset to XPP patching hook
- atpHook EQU 8 ; Offset to ATP patching hook
- agbSize EQU $10 ; Size of AGB
- ;
- AGBHandle EQU $0D1C ; handle to appletalk global block
- ;
- ;
- ;
- ; RTMP+ definitions (were in MPP.a)
- ;
- ;
- rtmpPlus EQU 5 ; DDP type for RTMP+ packet
- getNetInfo EQU 1 ; RTMP+ command type for GetNetInfo
- ;
- EJECT
- ;
- ; ASP definitions
- ;
- ;
- ; Offsets in user bytes
- ;
- aspCmdCode EQU 0 ; Offset to command field
- aspWSSNum EQU 1 ; WSS number in OpenSessions
- aspVersNum EQU 2 ; ASP version number in OpenSessions
- ;
- aspSSSNum EQU 0 ; SSS number in OpenSessReplies
- aspSessID EQU 1 ; Session ID (requests & OpenSessReply)
- aspOpenErr EQU 2 ; OpenSessReply error code
- ;
- aspSeqNum EQU 2 ; Sequence number in requests
- aspAttnCode EQU 2 ; Attention bytes in attentions
- ;
- ; Offsets in ATP data part
- ;
- aspWrBSize EQU 0 ; Offset to write buffer size (WriteData)
- aspWrHdrSz EQU 2 ; Size of data part
- ;
- ; ASP command codes - the following define the different types of ASP requests:
- ;
- aspCloseSess EQU 1 ; Close session
- aspCommand EQU 2 ; User-command
- aspGetStat EQU 3 ; Get status
- aspOpenSess EQU 4 ; Open session
- aspTickle EQU 5 ; Tickle
- aspWrite EQU 6 ; Write
- aspDataWrite EQU 7 ; WriteData (from server)
- aspAttention EQU 8 ; Attention (from server)
- ;
- ; ASP miscellaneous
- ;
- aspVersion EQU $0100 ; ASP version number
- maxCmdSize EQU atpMaxData ; Maximum command block size
- quantumSize EQU atpMaxData*atpMaxNum ; Maximum reply size
- xppLoadedBit EQU atpLoadedBit+1 ; XPP bit in PortBUse
- xppUnitNum EQU 40 ; Unit number for XPP (old ROMs)
- tickleInt EQU 30 ; Tickle interval (secs)
- tickleTime EQU tickleInt*60*4 ; Tickle timeout (ticks)
- ;
- ;+ Control codes. NOTE: high byte of CSCode used internally
- ;
- openSess EQU 255 ; Open session
- closeSess EQU 254 ; Close session
- userCommand EQU 253 ; User command
- userWrite EQU 252 ; User write
- getStatus EQU 251 ; Get status
- afpCall EQU 250 ; AFP command (buffer has command code)
- getParms EQU 249 ; Get parameters
- abortOS EQU 248 ; Abort open session request
- closeAll EQU 247 ; Close all open sessions
- ;
- firstXPP EQU closeAll ; First XPP command
- lastXPP EQU openSess ; Last XPP command
- ;
- ; ASP queue element standard structure: arguments passed in the CSParam area
- ;
- sessRefnum EQU $1C ; Offset to session refnum [word]
- aspTimeout EQU $1E ; Timeout for ATP [byte]
- aspRetry EQU $1F ; Retry count for ATP [byte]
- serverAddr EQU $20 ; Server address block [longword]
- scbPointer EQU $24 ; SCB pointer [longword]
- attnRoutine EQU $28 ; Attention routine pointer [long]
- ;
- cbSize EQU $20 ; Command block size [word]
- cbPtr EQU $22 ; Command block pointer [long]
- rbSize EQU $26 ; Reply buffer size [word]
- rbPtr EQU $28 ; Reply buffer pointer [long]
- wdSize EQU $2C ; Write data size [word]
- wdPtr EQU $2E ; Write data pointer [long]
- ccbStart EQU $32 ; Start of memory for CCB
- ;
- aspMaxCmdSize EQU $1C ; For SPGetParms [word]
- aspQuantumSize EQU $1E ; For SPGetParms [word]
- numSesss EQU $20 ; For SPGetParms [word]
- ;
- abortSCBPtr EQU $1C ; SCB pointer for AbortOS [long]
- ;
- cmdResult EQU $12 ; Command result (ATP user bytes) [long]
- ;
- afpAddrBlock EQU $2C ; Address block in AFP login [long]
- afpSCBPtr EQU $30 ; SCB pointer in AFP login [long]
- afpAttnRoutine EQU $34 ; Attn routine pointer in AFP login
- ;
- scbMemSize EQU $C0 ; Size of memory for SCB
- EJECT
- ;______________________________________________________________
- ;
- ; AFP Command command codes
- ;______________________________________________________________
- ;
- afpByteRangeLock EQU 1
- afpVolClose EQU 2
- afpDirClose EQU 3
- afpForkClose EQU 4
- afpCopyFile EQU 5
- afpDirCreate EQU 6
- afpFileCreate EQU 7
- afpDelete EQU 8
- afpEnumerate EQU 9
- afpFlush EQU 10
- afpForkFlush EQU 11
- afpGetDirParms EQU 12
- afpGetFileParms EQU 13
- afpGetForkParms EQU 14
- afpGetSInfo EQU 15
- afpGetSParms EQU 16
- afpGetVolParms EQU 17
- afpLogin EQU 18
- afpContLogin EQU 19
- afpLogout EQU 20
- afpMapID EQU 21
- afpMapName EQU 22
- afpMove EQU 23
- afpOpenVol EQU 24
- afpOpenDir EQU 25
- afpOpenFork EQU 26
- afpRead EQU 27
- afpRename EQU 28
- afpSetDirParms EQU 29
- afpSetFileParms EQU 30
- afpSetForkParms EQU 31
- afpSetVolParms EQU 32
- afpWrite EQU 33
- afpGetFlDrParms EQU 34
- afpSetFlDrParms EQU 35
- ;
- afpDTOpen EQU 48
- afpDTClose EQU 49
- afpGetIcon EQU 51
- afpGtIcnInfo EQU 52
- afpAddAPPL EQU 53
- afpRmvAPPL EQU 54
- afpGetAPPL EQU 55
- afpAddCmt EQU 56
- afpRmvCmt EQU 57
- afpGetCmt EQU 58
- ;
- afpAddIcon EQU 192 ; Special code for ASP Write commands
- ;
- ;____________________________________
- ;
- ; Offsets for certain parameters in AFP Read/Write calls
- ;____________________________________
- ;
- startEndFlag EQU $1 ; Write only; offset relative to start or end
- rwOffset EQU $4 ; Offset at which to start read or write
- reqCount EQU $8 ; Count of bytes to read or write
- newLineFlag EQU $C ; Read only; newline character flag
- newLineChar EQU $D ; Read only; newline character
- ;
- lastWritten EQU $0 ; Write only; last written (returned)
- ;
- ;____________________________________
- ;
- ; Miscellaneous
- ;____________________________________
- ;
- afpUseWrite EQU $C0 ; first call in range that maps to an ASPWrite
-